#ifndef EXPRESSION_EVALUATOR_H
#define EXPRESSION_EVALUATOR_H

#include "execution/catalog.h"
#include <string>
#include <vector>

class ExpressionEvaluator {
public:
    ExpressionEvaluator(const Catalog& catalog) : catalog(catalog) {}
    
    bool evaluate(const std::string& filter, const std::vector<std::string>& record, const TableInfo& tableInfo);
    bool evaluate(const std::string& filter, const std::vector<std::string>& record, const TableInfo& tableInfo, int line, int column);
    static std::string getColumnValue(const std::string& columnName, const std::vector<std::string>& record, const TableInfo& tableInfo);
    static bool compareValues(const std::string& left, const std::string& op, const std::string& right, int line = 0, int column = 0);
    
    const Catalog& catalog;
};

#endif // EXPRESSION_EVALUATOR_H
